<?php

require '../utils/conn.php';
include_once '../models/machineList.php';

function getMachineListByExam($exam) {

	$query = "SELECT * FROM t_machine_list WHERE type = ".$exam;
	$result = mysql_query($query)  or die("查询单词出现错误：". mysql_error());
	$row = mysql_fetch_array($result, MYSQL_ASSOC);

	$machineList = new MachineList();

	$machineList->setMlId($row['ml_id']);
	$machineList->setTitle($row['title']);
	$machineList->setExamtype($row['type']);
	$machineList->setTimestamp($row['timestamp']);

	return $machineList;
}

?>